import sys,os,inspect
from PyQt4.QtGui import QMainWindow, QApplication
from PyQt4 import QtCore
sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(), os.pardir)))## add root path 
from KUI.ui_KMainWindow import Ui_MainWindow
from KUI.KDatabaseUI.KDatabaseWidget import KDatabaseWidget
from KCharts.KChartsWidget import KChartsWidget
from KUI.KCentralWidget import KCentralWidget
class MainWindow(QMainWindow, Ui_MainWindow):
	def __init__(self, parent=None):
		super(MainWindow, self).__init__(parent)
		self.setupUi(self)
		self.ctlwgt=KCentralWidget()
		self.setCentralWidget(self.ctlwgt)

		self.actionDatabase.triggered.connect(self.On_ClickMangeDatabase)
		self.actionChart.triggered.connect(self.On_ViewChart)
	def  On_ClickMangeDatabase(self):
		self.dbwidget=KDatabaseWidget()
		self.dbwidget.show()
	def  On_ViewChart(self):
		self.mcharts=KChartsWidget()
		self.mcharts.show()  

		


if __name__ == '__main__':
	app = QApplication(sys.argv)

	frame = MainWindow()
	frame.showMaximized()    
	app.exec_()